import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import articleRoutes from './modules/article';
import albumRoutes from './modules/album';
import manageRoutes from './modules/manage';
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    // redirect: '/home',
    component: Home
  },
  ...articleRoutes,
  ...albumRoutes,
  ...manageRoutes,
  {
    path: '*',  // 404页面
    component: () => import('../views/404.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
